package com.usian.admin.controller;

import com.usian.admin.service.LoginService;
import com.usian.apis.admin.LoginControllerApi;
import com.usian.model.admin.dtos.AdUserDto;
import com.usian.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
@Api(value = "登录验证",tags = "Ad_User",description = "登录验证API")
public class LoginController implements LoginControllerApi {

    @Autowired
    private LoginService loginService;

    @PostMapping("/in")
    @ApiOperation(value = "登录信息认证",notes = "根据用户名进行信息认证")
    @ApiImplicitParam(name = "dto",type = "AdUserDto",value ="根据用户名登录")
    @Override
    public ResponseResult login(@RequestBody AdUserDto dto) {
        return loginService.login(dto);
    }
}
